<include file="Public/head"/>

<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
	                <button type="button"  class="btn btn-purple btn-sm pri" onclick='preview(1);' >
		                 <span class="ace-icon fa fa-print icon-on-right bigger-110"></span>
		                   	 打印当前页
		             </button>
		             <!--startprint1-->
                    <div class="space-4"></div>
                    <h2 class=" text-center">在线报名财务详情页</h2>
                    <h5>驾校名称：{$name}</h5>
                    <h5>时&nbsp;&nbsp;间&nbsp;&nbsp;段：{$dateS|date='Y-m-d',###}&nbsp;至&nbsp;{$dateE|date='Y-m-d',###}</h5>
                    <form id="form" method="post" action="{:U('del')}">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th class='center'>用户姓名</th>
                                <th class='center'>身份证号</th>
                                <th class='center'>手机</th>
                                <th class='center'>驾照</th>
                                <th class='center'>班型</th>
                                <th class='center'>价格</th>
                                <th class='center'>支付类型</th>
                                <th class='center'>付款时间</th>
                                <th class='center'>报名时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if(!empty($list)){ ?>
                            <foreach name="list" item="val">
                                <tr>
                                    <td class='center'>{$val['user_name']}</td>
                                    <td class='center'>{$val['id_card']}</td>
                                    <td class='center'>{$val['phone']}</td>
                                    <td class='center'>{$val['type']}</td>
                                    <td class='center'>{$val['class_name']}</td>
                                    <td class='center'>￥&nbsp;{$val['money']}</td>
                                    <td class='center'><if condition ="$val['pay_way'] eq 1">线上支付<else/>线下支付</if></td>
                                    
                                    <if condition="$val['pay_time'] eq null">
                                        <td class='center'>--</td>
                                        <elseif condition="$val['is_paid'] eq 1"/>
                                        <td class='center'>{$val['pay_time']|date="Y-m-d H:i:s",###}</td>
                                    </if>
                                        <td class='center'>{$val['add_time']|date="Y-m-d H:i:s",###}</td>

                                </tr>
                            </foreach>
                            <tr>
                                 <td colspan='9' align='right'>本页合计：{$totalP}元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                             </tr>
                            <?php }else{?>
                            		<tr><td colspan="13" align="center" style='color:red;'>当前时间段没有数据！</td></tr>
                            <?php }?>
                            </tbody>
                        </table>
                    </form>
                    {$page}
                    <!--endprint1-->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div>
</div><!-- /.main-content -->
<include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">


function preview(oper) { 
	if (oper < 10) { 
	bdhtml = window.document.body.innerHTML;//获取当前页的html代码 
	sprnstr = "<!--startprint" + oper + "-->";//设置打印开始区域 
	eprnstr = "<!--endprint" + oper + "-->";//设置打印结束区域 
	prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html 
	prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));//从结束代码向前取html 
	window.document.body.innerHTML = prnhtml; 
	window.print(); 
	window.document.body.innerHTML = bdhtml; 
	} else { 
	window.print(); 
	}
}
    $(function () {
        $(".check-all").click(function () {
            $(".comments").prop("checked", this.checked);
        });
        $(".comments").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
        $("#submit").click(function () {
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除此类驾照？？",
                callback: function (result) {
                    if (result) {
                        $("#form").submit();
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
        $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除此类驾照？",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });

        var l_type = $('#l_type').val();
        $.ajax({
            url: "{:U('Sign/getClassLevel')}",
            type: 'post',
            dataType: 'json',
            data: {'l_type': l_type},
            success : function (res){
               if(res.res == 1){
                  var data = res.data;
                  var str = '<option value="">--请选择班级--</option>';
                    var c_id = "{:I('c_id')}";
                  for (var i = 0; i < data.length; i++) {
                    if(c_id == data[i]['id']){
                       str += '<option selected="selected" value="'+data[i]['id']+'">'+data[i]['name']+'</option>';
                    }else{
                        str += '<option value="'+data[i]['id']+'">'+data[i]['name']+'</option>';
                    }
                  }
                  $('#c_id').html();
                  $('#c_id').html(str);
               }            
           }
        });
    })

//搜索
$('#l_type').change(
    function(event) {
        var l_type = $('#l_type').val();
        $.ajax({
            url: "{:U('Sign/getClassLevel')}",
            type: 'post',
            dataType: 'json',
            data: {'l_type': l_type},
            success : function (res){
               if(res.res == 1){
                  var data = res.data;
                  var str = '<option value="">--请选择班级--</option>';
                  var c_id = "{:I('c_id')}";
                  for (var i = 0; i < data.length; i++) {
                     if(c_id == data[i]['id']){
                       str += '<option selected="selected" value="'+data[i]['id']+'">'+data[i]['name']+'</option>';
                    }else{
                        str += '<option value="'+data[i]['id']+'">'+data[i]['name']+'</option>';
                    }
                  }
                  $('#c_id').html();
                  $('#c_id').html(str);
               }            
           }
        })
        
});

function sou(){
    l_type = $('#l_type').val();
    c_id = $('#c_id').val();
    is_paid = $('#is_paid').val();
    var param = '';
    if(c_id){
        param += '/c_id/'+c_id; 
    }
    if(l_type){
        param += '/l_type/'+l_type;
    }
    if(is_paid !=='n'){
        param += '/is_paid/'+is_paid;
    }
    location.href="__APP__/Admin/Sign/index"+param+".html";
}
function dayin(){ 
    location.href='__APP__/Admin/Sign/dayin.html';
}
</script>
</body>
</html>
                            